package com.conversationboard.filedownload;

import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class FileExtension {

	private static Pattern fileExtensionPattern = Pattern.compile("^.*?(\\..*)$", (Pattern.DOTALL | Pattern.CASE_INSENSITIVE));

	
	public static String get(String fileName) {
		
		Matcher matcher = fileExtensionPattern.matcher(fileName);
		String extension = "";
		
		if (matcher.find()) {
			extension = matcher.group(1);
		}
		
		return extension;

	}
	
}
